<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Word/Excel Demo</title>
</head>
<body>
<script type="text/javascript">
function viewDoc(){
	openDocObj = new ActiveXObject("SharePoint.OpenDocuments.1"); 
	openDocObj.ViewDocument("<%=basePath%>doc/How to Run MyFaces in JBoss Enterprise 5.0.0.GA.doc");
}
function editDoc(){
	openDocObj = new ActiveXObject("SharePoint.OpenDocuments.1"); 
	openDocObj.EditDocument("<%=basePath%>doc/How to Run MyFaces in JBoss Enterprise 5.0.0.GA.doc");
}
function createDoc(){
	openDocObj = new ActiveXObject("SharePoint.OpenDocuments.1"); 
	openDocObj.CreateNewDocument("<%=basePath%>/sampleTemplate.dot", "<%=basePath%>/doc/");
}
</script>
<hr>
<a href="javascript:viewDoc()">View Doc</a>
<br/>
<a href="javascript:editDoc()">Edit Doc</a>
<br/>
<hr>
<a href="javascript:createDoc()">Create a Doc</a>
</body>
</html>